package pattern;

import java.util.ArrayList;

public abstract class ShoeModel {
	
	public static final int NUM_OF_POINTS = 8;
	
	private ArrayList<Double> pressures = new ArrayList<Double>(8);
	
	public void setPressures(ArrayList<Double> pressures) {
		for(int i = 0; i < NUM_OF_POINTS; i++) {
			// normal case
			if(i < pressures.size() && pressures.get(i) >= 0) {
				this.pressures.add(pressures.get(i));
			}
			// abnormal case -- pressure is less than 0 or short of size
			else {
				this.pressures.add(0.0);
			}
		}
	}
	
	/**
	 * This index starts from 0, ends with 7
	 * @param index
	 */
	public double getPressure(int index) {
		return pressures.get(index);
	}
}
